package com.yzw.hello.controller.system;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.yzw.hello.service.system.user.UserService;

@Controller
@RequestMapping("user")
public class UserController {

	@Autowired
	private UserService userService;
	
	@RequestMapping("/manage")
	public String manage(Model model) {
		model.addAttribute("users", userService.getList());
		return "system/user/user";
	}
	
	@RequestMapping("/userInfo")
	public String userInfo(Model model,HttpServletRequest request) {
		Integer id = Integer.parseInt(request.getParameter("id"));
		model.addAttribute("user", userService.getOne(id));
		return "system/user/userInfo";
	}
	
}
